import os.path
from pluginsystem.PluginBase import Plugin

class Doxygen(Plugin):
    def __init__(self):
        self.set_keyword("Doxygen")
        self.set_mime_type("TEXT/HTML")
    
    def check(self, config):
        if config.has_key("doxygendir"):
            return os.path.exists(self.get_file(config))
        
    def get_file(self, config):
        docdir = self.get_documentation_path()
        basedir = config["basedir"]
        doxydir = config["doxygendir"]
        file = "index.html"
        return os.path.join(docdir,basedir,doxydir, file)